package com.phiture.erp.sale.dal.mapper;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.phiture.erp.sale.dal.entity.ErpSaleOutDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author YH
 * @date 2025/4/8
 */

@Mapper
public interface ErpSaleOutMapper extends BaseMapperX<ErpSaleOutDO> {
    default int updateByIdAndStatus(Long id, Integer status, ErpSaleOutDO updateObj) {
        return update(updateObj, new LambdaUpdateWrapper<ErpSaleOutDO>()
                .eq(ErpSaleOutDO::getId, id).eq(ErpSaleOutDO::getStatus, status));
    }

    default List<ErpSaleOutDO> selectListByOrderId(Long orderId) {
        return selectList(ErpSaleOutDO::getOrderId, orderId);
    }
}
